<?php
namespace app\servergoods\logic;
use \app\manage\logic\BaseLogic;
use \app\manage\service\ApiBase;
/**
 * @author:      李颖
 * @DateTime:    2017-07-26 15:00:39
 * @Description: 商品分类
 */
class GoodsCategory extends BaseLogic
{
	
	protected $goodsCategoryLogic = '\app\servergoods\logic\GoodsCategory';
    protected $goodsCategoryValidate = '\app\servergoods\validate\GoodsCategory';

    use \app\serveruser\traits\AddAppIdToRunOne;

    //获取分类树
    public function goodsCateList($data): array
    {
    	return $this->_addAppIdToRunOne($data, 'servergoods/goods/GoodsCategory/goodsCateList', $this->goodsCategoryValidate, $this->goodsCategoryLogic);
    }

    //亚艺后台获取某商品分类信息
    public function oneCateInfo($data): array 
    {
        return $this->_addAppIdToRunOne($data, 'servergoods/goods/GoodsCategory/oneCateInfo', $this->goodsCategoryValidate, $this->goodsCategoryLogic);
    }

    /*编辑商品分类*/
    public function editGoodsCate($data): array 
    {
        return $this->_addAppIdToRunOne($data, 'servergoods/goods/GoodsCategory/editGoodsCate', $this->goodsCategoryValidate, $this->goodsCategoryLogic);
    }

    /*
        根据id数组 启用/禁用一个或多个分类
        父类被禁用，则其所有子类也被禁用，开启同理
    */
    public function changeCateStatus($data): array
    {
        return $this->_addAppIdToRunOne($data,'servergoods/goods/GoodsCategory/changeCateStatus', $this->goodsCategoryValidate, $this->goodsCategoryLogic);
    }

    //删除一个或多个商品分类
    public function delCate($data): array
    {
        return $this->_addAppIdToRunOne($data,'servergoods/goods/GoodsCategory/delCate', $this->goodsCategoryValidate, $this->goodsCategoryLogic);
    }

    //获取该父类的所有属性合集
    public function parentAllAttrs($data): array
    {
        return $this->_addAppIdToRunOne($data,'servergoods/goods/GoodsCategory/parentAllAttrs', $this->goodsCategoryValidate, $this->goodsCategoryLogic);
    }





}